﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserInCommunityProfilesAdmin.ascx.cs"
    Inherits="Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenCommunity.UserInCommunityProfilesAdmin" %>
<%@ Import Namespace="Telerik.Web.UI" %>
<owc:OwGrid ID="UserInCommunityProfilesAdminGrid" runat="server" AutoGenerateColumns="False"
    CellSpacing="0" DataSourceID="UserInCommunityProfileOds" GridLines="None" OwEnableMessageDisplay="True"
    SkinID="OwGridAdmin" OwMessageDisplayType="InPlace">
    <mastertableview datasourceid="UserInCommunityProfileOds" datakeynames="UsersInOpenCommunityProfilesIDf">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <owct:GridBoundColumn DataField="UsersInOpenCommunityProfilesID" DataType="System.Int64"
                FilterControlAltText="Filter UsersInOpenCommunityProfilesID column" HeaderText="UsersInOpenCommunityProfilesID"
                SortExpression="UsersInOpenCommunityProfilesID" UniqueName="UsersInOpenCommunityProfilesID">
            </owct:GridBoundColumn>
            <owct:GridBoundColumn DataField="UserID" DataType="System.Guid" FilterControlAltText="Filter UserID column"
                HeaderText="UserID" SortExpression="UserID" UniqueName="UserID">
            </owct:GridBoundColumn>
            <owct:GridBoundColumn DataField="OpenCommunityProfileID" DataType="System.Int64"
                FilterControlAltText="Filter OpenCommunityProfileID column" HeaderText="OpenCommunityProfileID"
                SortExpression="OpenCommunityProfileID" UniqueName="OpenCommunityProfileID">
            </owct:GridBoundColumn>
            <owct:GridBoundColumn DataField="CommunityUserPositionID" DataType="System.Int64"
                FilterControlAltText="Filter CommunityUserPositionID column" HeaderText="CommunityUserPositionID"
                SortExpression="CommunityUserPositionID" UniqueName="CommunityUserPositionID">
            </owct:GridBoundColumn>
            <owct:GridCheckBoxColumn DataField="IsDeleted" DataType="System.Boolean" FilterControlAltText="Filter IsDeleted column"
                HeaderText="IsDeleted" SortExpression="IsDeleted" UniqueName="IsDeleted">
            </owct:GridCheckBoxColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
            <FormTemplate>
                <table>
                  <owc:OwTextBox SkinID="OwTextBox" OwDefaultValue='<%# Membership.GetUser()!=null? Membership.GetUser().ProviderUserKey:null %>'
                            ID="UserIDTxt" Visible="false" runat="server" Text='<%# Bind("UserID")%>' />
                  
                    <tr>
                        <td>
                            <owc:OwR runat="server" OwText="OpenCommunityProfile" />
                        </td>
                        <td>
                            <owc:OwObjectDataSource ID="OpenCommunityProfileOds" runat="server" DataObjectTypeName="Micronet.OpenWeb.Entity.OwOpenCommunityProfilesEntity"
                                DeleteMethod="OwDelete" InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}"
                                SelectMethod="OwGetByDynamic" TypeName="Micronet.OpenWeb.Com.BLL.OwOpenCommunityProfilesBLL"
                                UpdateMethod="OwUpdate">
                                <SelectParameters>
                                    <asp:Parameter Name="isDeleted" Type="Boolean" DefaultValue="" />
                                    <asp:Parameter Name="communityID" Type="Int64" />
                                    <asp:Parameter Name="defaultOpenCommunityProfileDetailID" Type="Int64" />
                                    <asp:Parameter Name="sortClause" Type="String" />
                                    <asp:Parameter Name="sortDirection" Type="String" />
                                    <asp:Parameter Name="startRowIndex" Type="Int32" />
                                    <asp:Parameter Name="maximumRows" Type="Int32" />
                                </SelectParameters>
                            </owc:OwObjectDataSource>
                            <owc:OwComboBox ID="OpenCommunityProfileCbb" runat="server" 
                                DataSourceID="OpenCommunityProfileOds" SkinID="OwComboBox" SelectedValue='<%# Bind("OpenCommunityProfileID") %>'
                                DataTextField="OpenCommunityProfileID" 
                                DataValueField="OpenCommunityProfileID">
                            </owc:OwComboBox>
                        </td>
                    </tr>
                    <tr>
                       
                        <td> <owc:OwR runat="server" OwText="CommunityUserPosition" />
                        </td>
                        <td>
                            <owc:OwComboBox ID="OwCommunityUserPositionsCbb" runat="server" AppendDataBoundItems="true" SkinID="OwComboBox" SelectedValue='<%# Bind("CommunityUserPositionID") %>'
                                Style="margin-bottom: 0px" OnInit="OwCommunityUserPositionsCbb_Init">
                            </owc:OwComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <owc:OwR runat="server" OwText="IsDeleted" />
                        </td>
                        <td>
                            <owc:OwCheckBox ID="IsDeletedCb" runat="server" Checked='<%# Bind("IsDeleted") %>'
                                SkinID="OwCheckBoxAdmin" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td >
                            <owc:OwButton ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                                SkinID="OwButtonAdmin">
                            </owc:OwButton>
                            <owc:OwButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                SkinID="OwButtonAdmin" CommandName="Cancel">
                            </owc:OwButton>
                        </td>
                        
                    </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
    </mastertableview>
    <filtermenu enableimagesprites="False">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </filtermenu>
    <headercontextmenu cssclass="GridContextMenu GridContextMenu_Default">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </headercontextmenu>
</owc:OwGrid>
<owc:OwObjectDataSource ID="UserInCommunityProfileOds" runat="server" DeleteMethod="OwDelete"
    InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}" SelectMethod="OwGetByDynamic"
    TypeName="Micronet.OpenWeb.Com.BLL.OwUsersInCommunityProfilesBLL" UpdateMethod="OwUpdate">
    <deleteparameters>
        <asp:Parameter Name="usersInOpenCommunityProfilesID" Type="Int64" />
    </deleteparameters>
    <insertparameters>
        <asp:Parameter Name="usersInOpenCommunityProfilesID" Type="Int64" />
        <asp:Parameter DbType="Guid" Name="userID" />
        <asp:Parameter Name="openCommunityProfileID" Type="Int64" />
        <asp:Parameter Name="communityUserPositionID" Type="Int64" />
        <asp:Parameter Name="isDeleted" Type="Boolean" />
    </insertparameters>
    <selectparameters>
        <asp:Parameter DbType="Guid" Name="userID" />
        <asp:Parameter Name="isDeleted" Type="Boolean" />
        <asp:Parameter Name="openCommunityProfileID" Type="Int64" />
        <asp:Parameter Name="communityUserPositionID" Type="Int64" />
        <asp:Parameter Name="sortClause" Type="String" />
        <asp:Parameter Name="sortDirection" Type="String" />
        <asp:Parameter Name="startRowIndex" Type="Int32" />
        <asp:Parameter Name="maximumRows" Type="Int32" />
    </selectparameters>
    <updateparameters>
        <asp:Parameter Name="usersInOpenCommunityProfilesID" Type="Int64" />
        <asp:Parameter DbType="Guid" Name="userID" />
        <asp:Parameter Name="openCommunityProfileID" Type="Int64" />
        <asp:Parameter Name="communityUserPositionID" Type="Int64" />
        <asp:Parameter Name="isDeleted" Type="Boolean" />
    </updateparameters>
</owc:OwObjectDataSource>

<owc:OwDetailsView ID="OwDv" runat="server" AutoGenerateRows="False" 
    DataSourceID="OwObjectDataSource1" EnableModelValidation="True"  DataKeyNames="usersInOpenCommunityProfilesID"
    OwNotificationID="">
    <Fields>
      <asp:TemplateField runat="server">
      <InsertItemTemplate>
            <table>
                  <owc:OwTextBox SkinID="OwTextBox" OwDefaultValue='<%# Membership.GetUser()!=null? Membership.GetUser().ProviderUserKey:null %>'
                            ID="UserIDTxt" Visible="false" runat="server" Text='<%# Bind("UserID")%>' />
                  
                    <tr>
                        <td>
                            <owc:OwR ID="OwR1" runat="server" OwText="OpenCommunityProfile" />
                        </td>
                        <td>
                            <owc:OwObjectDataSource ID="OpenCommunityProfileOds" runat="server" DataObjectTypeName="Micronet.OpenWeb.Entity.OwOpenCommunityProfilesEntity"
                                DeleteMethod="OwDelete" InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}"
                                SelectMethod="OwGetByDynamic" TypeName="Micronet.OpenWeb.Com.BLL.OwOpenCommunityProfilesBLL"
                                UpdateMethod="OwUpdate">
                                <SelectParameters>
                                    <asp:Parameter Name="isDeleted" Type="Boolean" DefaultValue="" />
                                    <asp:Parameter Name="communityID" Type="Int64" />
                                    <asp:Parameter Name="defaultOpenCommunityProfileDetailID" Type="Int64" />
                                    <asp:Parameter Name="sortClause" Type="String" />
                                    <asp:Parameter Name="sortDirection" Type="String" />
                                    <asp:Parameter Name="startRowIndex" Type="Int32" />
                                    <asp:Parameter Name="maximumRows" Type="Int32" />
                                </SelectParameters>
                            </owc:OwObjectDataSource>
                            <owc:OwComboBox ID="OpenCommunityProfileCbb" runat="server" 
                                DataSourceID="OpenCommunityProfileOds" SkinID="OwComboBox" SelectedValue='<%# Bind("OpenCommunityProfileID") %>'
                                DataTextField="OpenCommunityProfileID" 
                                DataValueField="OpenCommunityProfileID">
                            </owc:OwComboBox>
                        </td>
                    </tr>
                    <tr>
                       
                        <td> <owc:OwR ID="OwR2" runat="server" OwText="CommunityUserPosition" />
                        </td>
                        <td>
                            <owc:OwComboBox ID="OwCommunityUserPositionsCbb" runat="server" AppendDataBoundItems="true" SkinID="OwComboBox" SelectedValue='<%# Bind("CommunityUserPositionID") %>'
                                Style="margin-bottom: 0px" OnInit="OwCommunityUserPositionsCbb_Init">
                            </owc:OwComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <owc:OwR ID="OwR3" runat="server" OwText="IsDeleted" />
                        </td>
                        <td>
                            <owc:OwCheckBox ID="IsDeletedCb" runat="server" Checked='<%# Bind("IsDeleted") %>'
                                SkinID="OwCheckBoxAdmin" />
                        </td>
                    </tr>
               
                </table>
      
      </InsertItemTemplate>
      </asp:TemplateField>
     
         <asp:TemplateField ShowHeader="False">
            <EditItemTemplate>
                <fieldset style="position: fixed; bottom: 0px; right: 0px; width: 100%">
                    <legend>
                        <asp:Label ID="Label4" runat="server" EnableViewState="false" Text="<%$ OwR: Action %>" /></legend>
                    </owc:OwButton>
                    <owc:OwButton ID="EditUpdateThenCloseButton" runat="server" CommandName="Update"
                        Text='<%$OwR:Update %>' OnClientClicking="showNotification">
                    </owc:OwButton>
                    &nbsp;
                    <owc:OwConfirmButton ID="EditDeleteButton" runat="server" CausesValidation="True"
                        CommandName="Delete" Text="<%$OwR:Delete %>" SkinID="OwConfirmButton">
                    </owc:OwConfirmButton>
                    &nbsp;<owc:OwButton ID="EditCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="<%$OwR:Cancel %>">
                    </owc:OwButton>
                </fieldset>
            </EditItemTemplate>
            <InsertItemTemplate>
                <fieldset style="position: fixed; bottom: 0px; right: 0px; width: 100%">
                    <legend>
                        <asp:Label ID="Label42" runat="server" EnableViewState="false" Text="<%$ OwR: Action %>" /></legend>
                    <owc:OwButton ID="InsertInsertButton" runat="server" CommandName="Insert" Text="<%$OwR:Insert %>"
                        OnClientClicking="showNotification">
                    </owc:OwButton>
                    &nbsp;<owc:OwButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="<%$OwR:Cancel %>">
                    </owc:OwButton>
                </fieldset>
            </InsertItemTemplate>
        </asp:TemplateField>

    </Fields>
</owc:OwDetailsView>
<owc:OwObjectDataSource ID="OwObjectDataSource1" runat="server" 
    DeleteMethod="OwDelete" InsertMethod="OwInsert" 
    OldValuesParameterFormatString="original_{0}" SelectMethod="OwGetEntity" 
    TypeName="Micronet.OpenWeb.Com.BLL.OwUsersInCommunityProfilesBLL" 
    UpdateMethod="OwUpdate">
    <DeleteParameters>
        <asp:Parameter Name="usersInOpenCommunityProfilesID" Type="Int64" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="usersInOpenCommunityProfilesID" Type="Int64" />
        <asp:Parameter DbType="Guid" Name="userID" />
        <asp:Parameter Name="openCommunityProfileID" Type="Int64" />
        <asp:Parameter Name="communityUserPositionID" Type="Int64" />
        <asp:Parameter Name="isDeleted" Type="Boolean" />
    </InsertParameters>
    <SelectParameters>
        <asp:Parameter Name="usersInOpenCommunityProfilesID" Type="Int64" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="usersInOpenCommunityProfilesID" Type="Int64" />
        <asp:Parameter DbType="Guid" Name="userID" />
        <asp:Parameter Name="openCommunityProfileID" Type="Int64" />
        <asp:Parameter Name="communityUserPositionID" Type="Int64" />
        <asp:Parameter Name="isDeleted" Type="Boolean" />
    </UpdateParameters>
</owc:OwObjectDataSource>

